<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="Plus"
          @click="handleAdd"
          v-hasPermi="['index:annualPass:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['index:annualPass:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['index:annualPass:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-col>
      <right-toolbar
        v-model:showSearch="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="annualPassList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="年卡名称" align="center" prop="nkName"></el-table-column>
      <el-table-column label="年卡图(正)" align="center" prop=" nkPicturesCorrect
        ">
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.nkPicturesCorrect && row.nkPicturesCorrect != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.nkPicturesCorrect" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.nkPicturesCorrect)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="年卡图(反)"
        align="center"
        prop="nkPicturesAnti
       "
      >
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.nkPicturesAnti && row.nkPicturesAnti != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.nkPicturesAnti" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.nkPicturesAnti)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="首页图(正)" align="center" prop=" nkPicturesHomeCorrect
        ">
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.nkPicturesHomeCorrect && row.nkPicturesHomeCorrect != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.nkPicturesHomeCorrect" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.nkPicturesHomeCorrect)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="首页图(反)" align="center" prop="nkPicturesHomeAnti">
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.nkPicturesHomeAnti && row.nkPicturesHomeAnti != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.nkPicturesHomeAnti" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.nkPicturesHomeAnti)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="微信小程序二维码" align="center" prop="wxPicture">
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.wxPicture && row.wxPicture != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.wxPicture" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.wxPicture)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="支付宝二维码图片"
        align="center"
        prop="aliPicture"
      >
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.aliPicture && row.aliPicture != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.aliPicture" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.aliPicture)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="年卡美图" align="center" prop="nkMeitu">
        <template v-slot="{ row }">
          <div
            class="a_b"
            v-if="row.nkMeitu && row.nkMeitu != ''"
            style="height: 40px; margin: 0 auto; width: 40px"
          >
            <img :src="baseUrl + row.nkMeitu" alt="" class="a_b_a" />
            <span class="a_b_b" style="text-align: center">
              <span
                class="a_b_b_a"
                @click="handlePictureCardPreview(row.nkMeitu)"
              >
                <el-icon><zoom-in /></el-icon>
              </span>
            </span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="年卡美图按钮" prop="nkNameBtn" width="180" align="center">
        <template #default="scope">
          {{scope.row.nkNameBtn === 2 ? "白" : "黑" }}
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        align="center"
        fixed="right"
        width="180"
      >
        <template #default="scope">
          <el-button
            link
            type="primary"
            icon="Edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['index:annualPass:edit']"
            >修改</el-button
          >
          <el-button
            link
            type="primary"
            icon="Delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['index:annualPass:remove']"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改年卡阵地对话框 -->
    <el-drawer :title="title" v-model="open" size="65%" append-to-body>
      <el-form
        ref="annualPassRef"
        :model="form"
        :rules="rules"
        label-width="150px"
      >
        <el-form-item label="年卡名称" prop="nkName">
          <el-input v-model="form.nkName" placeholder="请输入年卡名称" />
        </el-form-item>
        <el-form-item label="年卡翻转图片(正)" prop="nkPicturesCorrect">
          <div class="a">
            <div
              class="a_b"
              v-if="form.nkPicturesCorrect && form.nkPicturesCorrect != ''"
            >
              <img
                :src="baseUrl + form.nkPicturesCorrect"
                alt=""
                class="a_b_a"
              />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.nkPicturesCorrect)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.nkPicturesCorrect, 2)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(2)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef2"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 2)"
              />
            </div>
          </div>
        </el-form-item>
        <el-form-item label="年卡翻转图片(反)" prop="nkPicturesAnti">
          <div class="a">
            <div
              class="a_b"
              v-if="form.nkPicturesAnti && form.nkPicturesAnti != ''"
            >
              <img
                :src="baseUrl + form.nkPicturesAnti"
                alt=""
                class="a_b_a"
              />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.nkPicturesAnti)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.nkPicturesAnti, 6)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(6)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef6"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 6)"
              />
            </div>
          </div>
        </el-form-item>
    
        <el-form-item label="首页翻转图片(正)" prop="nkPicturesHomeCorrect">
          <div class="a">
            <div
              class="a_b"
              v-if="form.nkPicturesHomeCorrect && form.nkPicturesHomeCorrect != ''"
            >
              <img :src="baseUrl + form.nkPicturesHomeCorrect" alt="" class="a_b_a" />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.nkPicturesHomeCorrect)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.nkPicturesHomeCorrect, 5)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(5)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef5"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 5)"
              />
            </div>
          </div>
        </el-form-item>
        <el-form-item label="首页翻转图片(反)" prop="nkPicturesHomeAnti">
          <div class="a">
            <div
              class="a_b"
              v-if="form.nkPicturesHomeAnti && form.nkPicturesHomeAnti != ''"
            >
              <img :src="baseUrl + form.nkPicturesHomeAnti" alt="" class="a_b_a" />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.nkPicturesHomeAnti)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.nkPicturesHomeAnti, 7)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(7)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef7"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 7)"
              />
            </div>
          </div>
        </el-form-item>
        <!-- 单传 -->
        <el-form-item label="微信二维码图片" prop="wxPicture">
          <div class="a">
            <div class="a_b" v-if="form.wxPicture && form.wxPicture != ''">
              <img :src="baseUrl + form.wxPicture" alt="" class="a_b_a" />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.wxPicture)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.wxPicture, 1)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(1)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef1"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 1)"
              />
            </div>
          </div>
        </el-form-item>
        <el-form-item label="支付宝二维码图片" prop="aliPicture">
          <div class="a">
            <div class="a_b" v-if="form.aliPicture && form.aliPicture != ''">
              <img :src="baseUrl + form.aliPicture" alt="" class="a_b_a" />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.aliPicture)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.aliPicture, 3)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(3)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef3"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 3)"
              />
            </div>
          </div>
        </el-form-item>
        <el-form-item label="年卡美图" prop="nkMeitu">
          <div class="a">
            <div class="a_b" v-if="form.nkMeitu && form.nkMeitu != ''">
              <img :src="baseUrl + form.nkMeitu" alt="" class="a_b_a" />
              <span class="a_b_b">
                <span
                  class="a_b_b_a"
                  @click="handlePictureCardPreview(form.nkMeitu)"
                >
                  <el-icon><zoom-in /></el-icon>
                </span>
                <span
                  class="a_b_b_b"
                  @click="handleDeletePicture(form.nkMeitu, 4)"
                >
                  <el-icon>
                    <Delete />
                  </el-icon>
                </span>
              </span>
            </div>
            <div class="a_a" @click="uploadClick(4)" v-else>
              <el-icon>
                <Plus />
              </el-icon>
              <input
                ref="inputRef4"
                name="file"
                accept=".jpg,.jpeg,.png"
                type="file"
                style="display: none"
                @change="(event) => changeFile(event, 4)"
              />
            </div>
          </div>
        </el-form-item>
        <el-form-item label="年卡美图按钮样式" prop="nkMeituBtn">
          <el-select v-model="form.nkNameBtn">
            <el-option
              :label="item.dictLabel"
              :value="item.dictValue"
              v-for="item in button_color"
              :key="item.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="支持景点" prop="annualPlaceList">
          <div class="tabclass">
            <el-table size="small" border :data="form.annualPlaceList">
              <el-table-column label="景点名称" align="center">
                <template v-slot="{ row, $index }">
                  <el-form-item
                    :prop="'annualPlaceList.' + $index + '.placeId'"
                    :rules="rules1.placeId"
                  >
                    <el-select
                      v-model="row.placeId"
                      filterable
                      placeholder="请选择景点名称"
                      style="width: 100%"
                    >
                      <el-option
                        v-for="item in openList"
                        :key="item.value"
                        :label="item.name"
                        :value="item.id"
                      />
                    </el-select>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="操作" align="center" width="60px">
                <template #default="scope">
                  <el-button
                    size="small"
                    type="primary"
                    @click="handleAdds"
                    v-if="scope.$index <= 0"
                    >新增</el-button
                  >
                  <el-button
                    size="small"
                    type="danger"
                    v-if="scope.$index != 0"
                    @click="handleDeletes(scope.row, scope.$index)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-drawer>
    <el-dialog v-model="dialogVisible">
      <img style="width: 100%" :src="dialogImageUrl" alt="Preview Image" />
    </el-dialog>
  </div>
</template>

<script setup name="AnnualPass">
import {
  listAnnualPass,
  getAnnualPass,
  delAnnualPass,
  addAnnualPass,
  updateAnnualPass,
  getplace,
} from "@/api/index/annualPass";
import { uploadFile } from "@/api/imgupload/index";
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
const { button_color } = proxy.useDict("button_color");

const annualPassList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");

const data = reactive({
  form: {
    nkNameBtn: '1'
  },
  queryParams: {
    pageNum: 1,
    pageSize: 999,
    nkPictures: null,
    nkPicturesHome: null,
    wxPicture: null,
    aliPicture: null,
    nkMeitu: null,
    valiFlag: null,
  },
  rules: {
    nkName: [{ required: true, message: "年卡名称不能为空", trigger: "blur" }],
    nkPicturesCorrect: [
      { required: true, message: "年卡翻转图片(正)不能为空", trigger: "blur" },
    ],
    nkPicturesHomeCorrect: [
      {
        required: true,
        message: "年卡翻转图片(正)不能为空",
        trigger: "blur",
      },
    ],
    nkPicturesAnti: [
      { required: true, message: "年卡翻转图片(反)不能为空", trigger: "blur" },
    ],
    nkPicturesHomeAnti: [
      {
        required: true,
        message: "年卡翻转图片(反)不能为空",
        trigger: "blur",
      },
    ],
    wxPicture: [
      { required: true, message: "微信小程序二维码不能为空", trigger: "blur" },
    ],
    aliPicture: [
      { required: true, message: "支付宝二维码图片不能为空", trigger: "blur" },
    ],
    nkMeitu: [{ required: true, message: "年卡美图不能为空", trigger: "blur" }],
  },
  rules1: {
    placeId: [{ required: true, message: "景点名称不能为空", trigger: "blur" }],
  },
});

const { queryParams, form, rules, rules1 } = toRefs(data);

// 获取景区列表
const openList = ref();
function getplaceList() {
  getplace().then((response) => {
    openList.value = response.rows;
  });
}

/** 查询年卡阵地列表 */
function getList() {
  loading.value = true;
  listAnnualPass(queryParams.value).then((response) => {
    annualPassList.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}

// 取消按钮
function cancel() {
  open.value = false;
  reset();
}

// 表单重置
function reset() {
  form.value = {
    id: null,
    nkPictures: null,
    nkPicturesHome: null,
    wxPicture: null,
    aliPicture: null,
    nkMeitu: null,
    nkNameBtn: 1,
    createTime: null,
    createBy: null,
    updateTime: null,
    updateBy: null,
    valiFlag: null,
    annualPlaceList: [{}],
  };
  proxy.resetForm("annualPassRef");
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef");
  handleQuery();
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map((item) => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
function handleAdd() {
  reset();
  open.value = true;
  title.value = "添加年卡阵地";
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  const _id = row.id || ids.value;
  getAnnualPass(_id).then((response) => {
    form.value = response.data;
    open.value = true;
    title.value = "修改年卡阵地";
  });
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["annualPassRef"].validate((valid) => {
    let parms = {
      ...form.value,
    };
    if (valid) {
      if (form.value.id != null) {
        updateAnnualPass(parms).then((response) => {
          proxy.$modal.msgSuccess("修改成功");
          open.value = false;
          getList();
        });
      } else {
        addAnnualPass(parms).then((response) => {
          proxy.$modal.msgSuccess("新增成功");
          open.value = false;
          getList();
        });
      }
    }
  });
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _ids = row.id || ids.value;
  proxy.$modal
    .confirm('是否确认删除年卡阵地编号为"' + _ids + '"的数据项？')
    .then(function () {
      return delAnnualPass(_ids);
    })
    .then(() => {
      getList();
      proxy.$modal.msgSuccess("删除成功");
    })
    .catch(() => {});
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download(
    "index/annualPass/export",
    {
      ...queryParams.value,
    },
    `annualPass_${new Date().getTime()}.xlsx`
  );
}
//新增列表按钮
const handleAdds = () => {
  form.value.annualPlaceList.push({});
};
// 删除列表按钮
const handleDeletes = (e, index) => {
  form.value.annualPlaceList.splice(index, 1);
};
//图片上传
const inputRef1 = ref();
const inputRef2 = ref();
const inputRef3 = ref();
const inputRef4 = ref();
const inputRef5 = ref();
const dialogImageUrl = ref();
const dialogVisible = ref(false);
const baseUrl = import.meta.env.VITE_BASE_URL;
const uploadClick = (type) => {
  proxy.$refs[`inputRef${type}`].click();
};
const changeFile = async (e, type) => {
  let files = e.target.files;
  for (let i = 0; i < files.length; i++) {
    let _file = files[i];
    var file = new FormData();
    file.append("files", _file);
    let res = await uploadFile(file);
    if (res.code == 200) {
      if (type == 1) {
        form.value.wxPicture = res.fileNames;
      } else if (type == 3) {
        form.value.aliPicture = res.fileNames;
      } else if (type == 4) {
        form.value.nkMeitu = res.fileNames;
      } else if (type == 2) {
        form.value.nkPicturesCorrect = res.fileNames;
      } else if (type == 5) {
        form.value.nkPicturesHomeCorrect = res.fileNames;
      } else if (type == 6) {
        form.value.nkPicturesAnti = res.fileNames;
      } else if (type == 7) {
        form.value.nkPicturesHomeAnti = res.fileNames;
      }
    }
  }
};
const handlePictureCardPreview = (file) => {
  dialogImageUrl.value = baseUrl + file;
  dialogVisible.value = true;
};
const handleDeletePicture = (file, type) => {
  if (type == 1) {
    form.value.wxPicture = "";
  } else if (type == 3) {
    form.value.aliPicture = "";
  } else if (type == 4) {
    form.value.nkMeitu = "";
  } else if (type == 2) {
    form.value.nkPicturesCorrect = "";
  } else if (type == 5) {
    form.value.nkPicturesHomeCorrect = "";
  }else if (type == 6) {
    form.value.nkPicturesAnti = "";
  } else if (type == 7) {
    form.value.nkPicturesHomeAnti = "";
  }
};
getList();
getplaceList();
</script>
<style scoped lang="scss">
.tabclass {
  width: 100%;
  ::v-deep {
    .el-form-item__error {
      display: contents;
    }
  }
}
.content {
  position: relative;

  &::-webkit-scrollbar {
    width: 2px;
    /* 滚动条宽度 */
  }

  /* 自定义滚动条轨道 */
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    /* 轨道颜色 */
  }

  /* 自定义滚动条的滑块（thumb） */
  &::-webkit-scrollbar-thumb {
    background: #888;
    /* 滑块颜色 */
  }

  /* 当hover或active状态时，自定义滑块的颜色 */
  &::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
}

.content_back {
  position: relative;

  &::after {
    content: "";
    position: absolute;
    // width: 100%;
    // height: 100%;
    // background: rgba(0,0,0,0.1);
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: 100;
  }
}

.a {
  display: flex;
  flex-wrap: wrap;
}

.a_a {
  width: 104px;
  height: 104px;
  border: 1px dashed var(--el-border-color);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--el-transition-duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    border-color: var(--el-color-primary);
  }
}

.a_b {
  margin: 0 8px 8px 0;
  border-radius: 6px;
  width: 104px;
  height: 104px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--el-border-color);

  .a_b_a {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .a_b_b {
    align-items: center;
    background-color: var(--el-overlay-color-lighter);
    color: #fff;
    cursor: default;
    display: inline-flex;
    font-size: 20px;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
    transition: opacity var(--el-transition-duration);
    width: 100%;

    .a_b_b_a {
      cursor: pointer;
      display: none;
    }

    .a_b_b_b {
      color: inherit;
      font-size: inherit;
      position: static;
      cursor: pointer;
      display: none;
      margin-left: 1rem;
    }
  }
}

.a_b:hover {
  .a_b_b {
    opacity: 1;
  }

  .a_b_b_a {
    display: block;
  }

  .a_b_b_b {
    display: block;
  }
}

.a_subTitle {
  font-size: 12px;
  color: red;
  line-height: 1.5;
  margin-top: 4px;
  width: 100%;
}

.b_subTitle {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.7;
  margin-top: 4px;
  width: 100%;

  p {
    margin: 0;
    padding: 0;
  }
}

.c {
  display: flex;
  align-items: center;
  margin: 4px 0;
  width: 100%;

  .c_a {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
  }

  .c_b {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
  }
}

.append ::v-deep(.el-input-group__append) {
  padding: 0 10px;
}

.d {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;

  .d_a {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
  }
}
</style>
